UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YRlnhmM+Ny2rgsBKwUlMcjXOWYa8hYGSqePn86tBiTs='
WHERE
key_id = 'dc1bb0576a0e56d27e2021b29d942ced8ffddbcce8ff2c3453bf18843e8152a9'
AND (
token = 'YRlnhmM+Ny2rgsBKwUlMcjXOWYa8hYGSqePn86tBiTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)