You cannot set, delete, move, or otherwise modify keyframes on a locked layer. Locking a layer is useful when you want to avoid overwriting its animation while you set keyframes on other layers.
See Muting, Soloing, and Locking animation layers and Animation Layer buttons.