private static function getTokenFromCache($name) {
    $success = false;
    $result = apc_fetch($name, $success);
    if ($success && time() < $result['eviction_time_epoch']) {
      unset($result['eviction_time_epoch']);
      return $result;
    }
    $memcache = new \Memcache();
    $result = $memcache->get($name);
    // If there was a result in memcache but not in apc we can add using a
    // short timeout.
    if ($result !== false) {
      self::putTokenInApc($name, $result, $result['expiration_time']);
    }
    return $result;
  }