UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xeXgSGFArjHLjW2qd7PfJJ1vwJtT9sJ89nLs8DDUWEA='
WHERE
key_id = '6781315219c090a6b252484e66ab32919d75fff5e8cbf6ec6f3bcd243d4fda45'
AND (
token = 'xeXgSGFArjHLjW2qd7PfJJ1vwJtT9sJ89nLs8DDUWEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)