UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZKd/65DwXOe2sn9oCGb2xZCzFj03BU5Ukc2vkZuR/oc=' 
WHERE 
  key_id = 'd002fe15b73829ae3b618a35adc21ce77c534a2c9bdb5d405737a7cffb459078' 
  AND (
    token = 'ZKd/65DwXOe2sn9oCGb2xZCzFj03BU5Ukc2vkZuR/oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038