UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VH4L+bKkqRlTIRcxpYgHmvBl5dT3eHULFvoO4vTpbj4='
WHERE
key_id = '80b24316f5b2f82d30c71d960289f3a839fcad0d9ece404e4199bb5a6228e65f'
AND (
token = 'VH4L+bKkqRlTIRcxpYgHmvBl5dT3eHULFvoO4vTpbj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)