UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ynTLXsF3PjtOx7aAcTRX1w9fukZknBTYje22CHoxhHg='
WHERE
key_id = '140a9115380a67dedc803a05f043b9b4f360448e0d3424b9ad142811233ee0b8'
AND (
token = 'ynTLXsF3PjtOx7aAcTRX1w9fukZknBTYje22CHoxhHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)