Not wax, tallow or animal fat (the stuff of candles before paraffin if you couldn't afford beeswax). It works, but it's messy on followup shots. Also make a little "barrel dam" in the groove between barrel and stock just forward of the lock, so rain can't follow the crack back to the pan.
A lock cover is a lot simpler, but the tallow will work if you're caught without the cover.