UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rQ5jMvcTLMIBCRPUrr7IO3MQdp8hHZnHru9ImT9zbnk='
WHERE
key_id = '59c0c70efd562f2e1235c6c870cb626eba0f2e2c88418e6c2049cfa75594a610'
AND (
token = 'rQ5jMvcTLMIBCRPUrr7IO3MQdp8hHZnHru9ImT9zbnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)