UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zAQQ2WNsQWfc1QSfyrvH2CYG6YfZ2Xilu4zTshZVGuY='
WHERE
key_id = '4e03b30788edd9d94c8b9e2299e1ed20b9e243166d3db93be9c3b76f36aacd6a'
AND (
token = 'zAQQ2WNsQWfc1QSfyrvH2CYG6YfZ2Xilu4zTshZVGuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)