UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uaz2p1leN5ppsyN3iwgY+nWFG0+KO2b7iED1kN9z/M4='
WHERE
key_id = '3cead656d0dc9aa749022dbc0c1b52f2d8dc2dde0847ae835cbeeacf88539e71'
AND (
token = 'uaz2p1leN5ppsyN3iwgY+nWFG0+KO2b7iED1kN9z/M4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)