UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FiLwE5iJzBfApzNTd/V/GzsXPUNR0z7yot5nJC9PyVU='
WHERE
key_id = '3b972f7115511a5e9073535a99bebdae72573f17182cb575455360a2d6c806c3'
AND (
token = 'FiLwE5iJzBfApzNTd/V/GzsXPUNR0z7yot5nJC9PyVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)