I would never use WD40 on any of my firearms, it's agriscopic
(attracts moisture) I've seen firearms totally rusted because the owner thought that spraying it with WD40 would preserve it, all it did was attract moisture and rusted all the metal. A good lube for the bolt would be a dry silicone spray.
WD-40 and all it's counterparts have one exclusive function and that is all it is meant for...breaking down rust. It is not designed to be a lubricant or long term rust inhibitor.
Locking lugs require light lube either grease very sparingly or lightly oiled, I usually put a light wipe of RCBS case lube on the lugs, super slippery stuff and seems to stay on for quite a while as well.
I use liquid moly grease from Germany on my lugs and the caming ramp. Rest is dry.