Personally I'd dissuade anyone from using WD40 for anything other than a rust-remover/all-else-fails cleaner, and with the caveat that as soon as it's performed it's job, clean it off with soapy water & a small soft brush (an old toothbrush is ideal) & rinse it several times & finally coat it with grease or oil. The stuff (WD40) contains acid, & was designed for use on things which were only expected to last for a finite period of time. NASA don't use it on the shuttle, only on the disposable SRB units & the release mechanisms (which are destroyed on launch). It may be classed as a lubricant, but it isn't one. I know many folk who keep a can in the back of their landrovers. Anyone tries to use it on my Disco takes their life in their hands, they're prone enough already. I'll only use electronic-contact cleaner & oil or waxoyl.
As originally described by Raz, the root of the problem is in allowing the rot to set in in the first place - it doesn't take long & boots generally don't come with anti-corrosion warranties. Waxoyl, available from any good garage or even Halfords, is an excellent sealer for metals & will not affect the other materials especially. Alternatively, just be liberal when waxing the boots (we recommend nikwax on our own boots). Hammerite paint on boots is one I've never heard of, but once the rust on the metal has been fully removed I imagine it's a good mid-term solution in itself.
Long-term, though, if you're spending a lot of time with your feet in seawater or deep mud/silt I'd recommend a pair of wellies rather than hiking boots!