There are numerous threads on here showing that there are common problems with VAG door locks, most seem to be the microswitches or dry joints inside the lock module. Most can be fixed with a little effort.
If you do get a new lock, as far as I know the key barrel can be kept and the electronics are elsewhere, so there is no recoding to be done. But since putting a new lock in is nearly as much effort as repairing the existing one, you should at least take a look at the first.