UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kaPnyAgALxhfH5yKzucuqo2KPL+aISaYtO3Gl8vUm0='
WHERE
key_id = '93ef71104f74fcf872a32aaffab4f779332b0981a087bc819399cf29e709d8cb'
AND (
token = '1kaPnyAgALxhfH5yKzucuqo2KPL+aISaYtO3Gl8vUm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)