A locksmith I know told me the best thing for his business/ worst thing to lubricate locks with is graphite. It clumps up when it gets damp and makes things worse. WD40 works well as said,it displaces moisture . You do need to reapply it occasionally.
On A side note,the best penetrating oil and lubricant I have found is made by Marvel Mystery Oil. Hard to find around here though.
Keith