UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'drEqEp+74BdsVeYVFTxupyoY4WoXELOoza5gO5wRF10='
WHERE
key_id = 'd260db37f6027e6ded31a1de082619c59f5d861ceb1471939dcfbe0518e855d7'
AND (
token = 'drEqEp+74BdsVeYVFTxupyoY4WoXELOoza5gO5wRF10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)