Control relay with two devices, where one can override the other
Here's the timing diagram.

And the relay logic based circuit.


A, B and K1 to K6 are standard relays.
C is a magnetic latch relay.
Freewheeling diodes are not shown.