Welcome to Basschat, though shame it's not in more cheerful circumstances. Really sorry to hear about the flood, and hopefully the insurance will cover the damage.
The WD in WD40 actually stands for Water Displacement, so using it to drive off moisture and prevent rust is perfectly fine. I've not used it on electronics, but I would.
Others with more experience will be along to advise about other gear, or you can repost in Repairs and Technical, where you'll definitely get help.
Fingers crossed 🤞.