UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ogxTsMqGHt7JJoq/budtQ/nJ2xn+xoTCV51Y8QHq8qA='
WHERE
key_id = '08166beeb222a7eab1ebf4b9f78c11ac5b0fcc3ac90a73fd28d7a7955cc1400a'
AND (
token = 'ogxTsMqGHt7JJoq/budtQ/nJ2xn+xoTCV51Y8QHq8qA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)