If that goes bad you have to get the safe opened by a locksmith. Mine went bad about 6 or 7 years ago and the cost of a locksmith coming to open the safe was simply more than I could swing at the time. My stuff just stayed locked up. I would try it a couple times a day because it acted like it wanted to work. One of my friends had the code since his guns were there riding out an ugly divorce. He was waiting for me to get home one day and was fiddling with it and got it open about the time I got inside. Cannon had already sent me new parts to replace the lock when I got it open. The safe was locked for at least 3 months. I cannot advise to buy an electronic lock.
All that said, there is a mechanical lock that will bolt right in for sale in multiple places. I bought mine from Amazon for about 75 bucks a couple years ago when it started acting funny again. Cannon would only send direct replacement parts, so I have an electronic lock sitting around but the mechanical is on the safe.
Cannon has done me right twice. No arguments at all there. They just wanted to know model, problem, and an address to send parts to. The lock is junk though, and I don’t trust it. Cannon outsources the locks from S&G and a few others. Buy a mechanical locking unit if you can. If it’s going to save you $100 bucks or more then buy the electronic lock safe and buy the replacement lock to swap into it. I had mine in and working in about an hour.