Realistically, keys are metallic, which are immune to stomach acids. Books are made out of mostly paper, ink, thread and glue. Thus, can be dissolved once it touches any acid, particularly stomach acid.
So unless if there’s a balance change that the books can only be spat out once (And the next time won’t be another chance), you’ll have to be very careful of not getting eaten if you have a book in hand.