private static function putTokenInCache($name, $value, $expiry_secs) {
    $expiry_time_from_epoch = $expiry_secs - self::EXPIRY_SAFETY_MARGIN_SECS -
        self::EXPIRY_SHORT_MARGIN_SECS;
    $memcache = new \Memcache();
    $memcache->set($name, $value, null, $expiry_time_from_epoch);
    // Record the expiry time in the object being cached, so we can check it
    // when read from APC.
    self::putTokenInApc($name, $value, $expiry_secs);
  }