Ah well, never hurts to try - spray penetrating grease for general maint. is the ticket - WD-40 as you tried to free up something that's already not working well.
Sometimes the problem with not locking is that it isn't fully latching, preventing the lock mechanism from working - normal operation as it won't lock when not fully latched...
So lubing then cycling mechanism by opening and closing a number of times would be the trick to be sure the "simple" fix isn't all you need.
Sounds like your problem is deeper, but this works for some with less of a problem..
(system's messing up again, hope this doesn't result in a double post..)