Check existing key mapping before setting it.