UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6rMudqz62LIsOED3h3qu7PmriftON1FHf6OokRtuAZ4='
WHERE
key_id = 'c04566b14f0dced90d07b8ce9c92e281d691c8edcc89aa40b73f52867c25b55f'
AND (
token = '6rMudqz62LIsOED3h3qu7PmriftON1FHf6OokRtuAZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)