UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ZSjFYwDNe1Rrt0oXIXXbO7lamBjsgueEHjrWJgRNF0='
WHERE
key_id = 'd204a3933a2cfa15ffcdb2403575e94ec2041402723ff12e35c37bb061f5eeed'
AND (
token = '7ZSjFYwDNe1Rrt0oXIXXbO7lamBjsgueEHjrWJgRNF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)