UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aHRkwzspKWIqHOHYIGcAgRH5gNNLYR6TSO6d8pNbcLo='
WHERE
key_id = '8632cb6cb166c9fd55d07af9d4bd7fd3ba8d171265adad10cef02f9182f71da6'
AND (
token = 'aHRkwzspKWIqHOHYIGcAgRH5gNNLYR6TSO6d8pNbcLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)