UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '66ORYHzPPmq9fmY7v8qUGQycC2ghZ5aor8xE84CiwM8='
WHERE
key_id = '44fa27d227466444aeb83bb45cc86d36010fed82eff4ac3254e46ce8cb56cda9'
AND (
token = '66ORYHzPPmq9fmY7v8qUGQycC2ghZ5aor8xE84CiwM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)