Ok, I'll start you off
First I want you to find a way to secure the opening of a condom or something similar to your open mouth gag so that the condom cannot be easily removed.
So it will sort of look like
this
You'll see why later.
Once this is done grab the key to your chastity device, put it into the condom and push it all the way to the bottom.
Next when you are desperate to shit do so into the condom.
Now the fun begins...
Insert the gag into your mouth and lock your chastity cage on.
Now without tearing the condom you must try and get the key out. Every time you squeeze it or try to move the key at the end the shit will end up in your mouth. Once you have the key in your mouth then you can remove the gag and unlock yourself.
I have not tried this so unsure how well it will work so make sure to stay safe as well.