UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Irqp84++cgwInuMTfbhdUKfgLvA3Yh+b409jMJyfeaA='
WHERE
key_id = '81d380ed8f8589e6b401da40b5b7564a01b1748e17d200b37b4ff69fbfa9923e'
AND (
token = 'Irqp84++cgwInuMTfbhdUKfgLvA3Yh+b409jMJyfeaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)