UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eGUSaHnGRx6+retMvgnZAxBEXj6CUJ8elFyqP7jYof0='
WHERE
key_id = '92085aecb9845726283143f0c8e6605bdf76aa58ee2b72e852a92d8f52f7967d'
AND (
token = 'eGUSaHnGRx6+retMvgnZAxBEXj6CUJ8elFyqP7jYof0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)