UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MUHkOD9OqrNWSdZxhh52K1ur+WjA3QlaC13ic6Hb+o='
WHERE
key_id = '9a62d1f2ed60c8a7693ede9f29d6934459d585f7dca99c53995e25f9ddf87ede'
AND (
token = '8MUHkOD9OqrNWSdZxhh52K1ur+WjA3QlaC13ic6Hb+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)