UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hYXEHfUFc40x/SLv+O11RZImJIMooEe5+nH8ZflsFj8='
WHERE
key_id = 'cd7ad91b848d9c4ba7507fe7898f8dc24db730d1c44bffbbfaec2867748f8dd0'
AND (
token = 'hYXEHfUFc40x/SLv+O11RZImJIMooEe5+nH8ZflsFj8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)