UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ox3PUmlKNA8V8XLnGQH9jco5tPT0hwJLjcUNEB3L38g='
WHERE
key_id = '9e97ad0b035e9fbbfd0f4eb46bf45276ce16047afc99c6f2a513b5e02ad96e87'
AND (
token = 'ox3PUmlKNA8V8XLnGQH9jco5tPT0hwJLjcUNEB3L38g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)