UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D7ncSrmNat4MCdQs4pD2NHNjOesCFwVG7yBeTb2jPYc='
WHERE
key_id = '5eb2a69f32cc6c7a4c3a98d3685c27ff70a597f31957c5ea31238651ec3086c6'
AND (
token = 'D7ncSrmNat4MCdQs4pD2NHNjOesCFwVG7yBeTb2jPYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)