Couldn't we just add all locked keys to the ctx.getAffectedKeys()?