UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SzxsVwkhMWmuRyjOtsDq0E919iANPpNcnbhpAiw4yLE='
WHERE
key_id = 'ff150a62bf07cb49d1f4f9a7971f21eabf811af9138a71d9dad39615318fb3d6'
AND (
token = 'SzxsVwkhMWmuRyjOtsDq0E919iANPpNcnbhpAiw4yLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)