If you align two objects to the left, Keynote will use the left-most object as the anchor point. Align to the right uses the right-most object. If you choose center, both objects will move to a center point equal distance from both.
Locking the object didn’t work in my test. It made the object unusable in an align situation. I could select it, but its position was ignored when aligning the second object, which instead was then aligned with the edge of the slide itself.
As far as I know, there is no way to force Keynote to use one object as the anchor and move the other, but maybe knowing the expected behavior will make it easier to put things where they are supposed to be.