UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c20loql+KyANbz30SIzajAQPw0CrLqrSrzDSZ/IsLYk='
WHERE
key_id = '4cbb92abba92b6505fb9e0ceb69e0b784f9c9658acae7d7e8adc1c92f78bde9a'
AND (
token = 'c20loql+KyANbz30SIzajAQPw0CrLqrSrzDSZ/IsLYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)