While everyone points out that WD-40 isn't a lubricant, that's not what the
@bikeman242 is asking for. He's looking to prevent corrosion, not lubricate.
WD-40 is indeed sold as a "corrosion inhibitor." The problem isn't that it evaporates, it's actually the opposite; That it sticks around and is somewhat tacky so it holds onto dirt, which gums things up. So, it is not appropriate for locks, which need lubrication to run smoothly. If you start using WD-40, then you'll be using it periodically in order to use fresh WD-40 to clean out old gummy WD-40.
Actually, many bike chain lubricants are appropriate for use in locks, as they're designed to lubricate and not attract/hold onto dirt.
But, if you don't already have corrosion, the standard for locks is dry powder graphite - but again that's for house door locks, which don't get the same rain/dirt/mud exposure as our bicycles can. I've read that synthetic lubricants like Tri-Flow are fine.