UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AB8q4RawtlmUiuTFSnlj+oskwS1tXNtfeW4T0w5dPhA='
WHERE
key_id = '53ff95e8659f7a1eefe0d3fdeef19b86fc57a429a2c9054cfaf066406ad0550a'
AND (
token = 'AB8q4RawtlmUiuTFSnlj+oskwS1tXNtfeW4T0w5dPhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)