UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iUUdeGkqsVgX/1vtufRCYCGZcq3a16377ylnIW1WoTg='
WHERE
key_id = 'ab5c911dffb9abde3d394d7d3b22ae7d1892ac12090761a37f941cdac2dfd39d'
AND (
token = 'iUUdeGkqsVgX/1vtufRCYCGZcq3a16377ylnIW1WoTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)