This question already has an answer here:
I have a very sticky door lock, is it safe to oil it with standard household oil?
Will oil degrade the security of the lock in any way?
If it's safe, how should I apply the oil?
No. You're likley to gum up the works. Graphite is common but not actually recommended. Not knowing the brand of your lock, I went and looked up one of the best-regarded lock makers (Medeco) and they recommend 3 products, two of which are not their house-branded product:
Medeco KeyLube 2.0 Multi-purpose Lubricant PX-KYLUB2-03 (5.25 oz.) Aerosol can with spray tube
Sandstrom Poxylube CP-200 Air Drying Solid Film Lubricant Poxylube CP-200 (4.5 oz.) Aerosol can with spray tube
Synco Super Lube Dri-Film Lubricant Super Lube Dri-Film (11 oz.) Aerosol can with spray tube
This existing DIY StackExchange question which will probably mean yours is closed as a duplicate has another suggestion LAB Locksmith Lube, (and another diss on graphite) by another respected lock maker, Yale:
Looks like the best consensus (there is a lot of conflicting information in that thread alone) is probably a dry-film spray-teflon product, these days.