How do I waterproof old hardwood floors in my bathroom?
I think that you should focus on the cause not the symptom.

So, what causes the toilet to overflow?

Is it a filling valve issue? have you checked?

Is the drain partially blocked?

Once you sort that then the floor should be fine.