I found a workaround that solves the problem, although I still have no idea what that red outline is supposed to be - you can get rid of it and the lock by simply copying the affected keyframes, deleting them and pasting them back in.
You can also lock a keyframe by pressing the Middle Mouse Button on it in the sequencer, and it will generate the red outline.