I have used WD40 plenty of times to clean and lubricant rusty locks, in my opinion it works better then most other lubricants out there. And No my lock did not had manual about right lubricant.
Many years ago I tried Super Lube® Multi-Purpose Synthetic Lubricant for locks exposed to weather 24x7, including one that spends 3 months a year buried in snow, and it is far superior to WD-40, as in multiple years of smooth operation without further maintenance. I might clean a lock with WD-40, but i am always going to lubricate outdoor locks with Super Lube. I have no idea if it works so well because of the base oils or the teflon additive or the combination, but it is really good stuff. This summer I used it to rehab my rusted grindy 38 year old Swing-A-Way can opener, which is now butter smooth, and to fix a seized outdoor A/C condenser fan. For both I had no direct access to the bearings and had to flood Super Lube down the shafts. Worked amazingly well.
you're using it to help break a stiff or rusty lock, but it's not lubricating anything.