Regrettably WD40 is NOT the answer to everything. It is a water displacing fluid (WD?) but does not do such a good job in the long term with protection and anti-corrosion work.
My fuel cap lock on my Honda 650 Deauville, the pannier lock AND the ignition were all heading south despite best efforts.
Only when I discovered ACF50 and started applying that regularly to the locks and pretty most other metal bits on the bike, that the locks finally freed up and worked perfectly thereafter.
It also freed up the pannier locks on my ST which didn't really work when I got it.
I have used it on all my outside padlocks (not on the bike) and it has worked wonders there too.
Hinges on our huge security gate also benefitted!
Whist this may be mechanically too late, I can only recommend giving it a go, after all what do you have to lose......
I used the key to hold the lock open and squirted ACF50 in on the first occasion but thereafter used the key to run it in off a paint brush.
A locksmith will of course tell you that graphite is the best lubricant, but that would really only apply from a position of it working now.....