Traditional lock lubrication is done with powdered graphite. It comes in a small squeeze tube resembling a toothpaste tube.
There is a specific aerosol made for locks that goes by the name Houdini. A web search will find it, it is not very common.
any petroleum-based product, such as WD-40, will act as a lubricant but will also act as an attractant for dust and it will gum up the lock in the long run.
Larry