UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r97H9O31xIAEofGopX3/BqDjRVO88E+fjryB+CcfWV8='
WHERE
key_id = '5d276ccc47d9998bdab79a89b14c29959c940969e9f574d70aab3465e68ab033'
AND (
token = 'r97H9O31xIAEofGopX3/BqDjRVO88E+fjryB+CcfWV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)