library update methods check if new key is same as old key

if new key is different from old key, remove entry with old key