Replacing door lock

Hi all, after the recent drama where I was locked out of my car with the battery out, I'm looking to fix the broken door lock. Especially since our cars have only 1 keyhole on the whole car.

Can I buy any used door lock with the corresponding key? Hoping there won't be any need to get a chip and reprogramming kerfaffle?

Happy to have separate keys to start the engine and to open the doors. Would the central locking still work with a different door lock mechanism?

Thanks in advance