UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iXtrfPl7P846rC/9rHe2/4v8yJG47qc+304aOQWVaJc='
WHERE
key_id = '1dc2865859ecd6fb9f27315f93e2f726f669a49e32928cc6bcfe6eebaffc1fa5'
AND (
token = 'iXtrfPl7P846rC/9rHe2/4v8yJG47qc+304aOQWVaJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)