UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2pMqcXmoIiaaLZWw3EL1P5tuSStxf7Hq575rHtBkg2U='
WHERE
key_id = 'b9fae7ae58bc3a8c56b72df7b039f0ddb836cdd9b211005ce999ecda00d50024'
AND (
token = '2pMqcXmoIiaaLZWw3EL1P5tuSStxf7Hq575rHtBkg2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)