UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXwm+FI2cT5mOLO7ZMuIIg1uOmVC8XaLDJvCNQvQBU8='
WHERE
key_id = 'c9adebdcc97bf5107518f01097c435f159803a72f3f7849254de3de3d106cc74'
AND (
token = 'RXwm+FI2cT5mOLO7ZMuIIg1uOmVC8XaLDJvCNQvQBU8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)