Set the expiration for a key as a UNIX timestamp
@param string $key
@param int $timestamp
@return boolean true if the timeout was set, false if key does not exist or the timeout could not be set
353586
public function expireat($key, $timestamp)
    {
        $this->init();
        $result = $this->driver->expireat($key, $timestamp);
        return (bool)$result;
    }
270168
public function expire($key, $seconds)
    {
        try {
            $value = $this->get($key);
        } catch (KeyNotFoundException $e) {
            return false;
        }

        return $this->getClient()->replace(
            $key,
            Util::getDataWithExpire($value, $seconds, time()),
            $seconds
        );
    }
461065
public function pexpireat($key, $milisecondsTimestamp)
    {
        $this->init();
        $result = $this->driver->pexpireat($key, $milisecondsTimestamp);
        return (bool)$result;
    }
11321
private function timestampHasExpired($timestamp) {
        $year   = substr($timestamp, 0, 4);
        $month  = substr($timestamp, 5, 2);
        $day    = substr($timestamp, 8, 2);
        $hour   = substr($timestamp, 11, 2);
        $minute = substr($timestamp, 14, 2);
        $second = substr($timestamp, 17, 2);

        $timestamp = gmmktime($hour, $minute, $second, $month, $day, $year);

        $diff = time() - $timestamp;

        if ($diff > $this->maxDiff || $diff < -$this->maxDiff) {
            return true;
        }

        return false;
    }
454341
public function setExpireAtMilliSeconds(int $timestamp): bool
    {
        return $this->handle->pExpireAt($this->name, $timestamp);
    }
1047391
public function setExpire(int $seconds) : bool
        {
                return $this->_redis->expire($this->_key, $seconds) > 0 ? true : false;
        }
1104582
public function isFresh($path, $timestamp)
    {
        $cachePath = $this->getCachePathFor($path);

        if (!file_exists($cachePath)) {
            return false;
        }

        return filemtime($cachePath) > $timestamp;
    }
731814
public function expired(string $key)
    {
        $path = $this->path($key);

        return $this->files->exists($path)
            ? \Carbon\Carbon::createFromTimestamp(
                substr($this->files->get($path), 0, 10)
            ) : null;
    }
1120058
public function expiration($key)
	{
		if (isset($this->data[static::EXPIRE_DATA_KEY][$key]))
		{
			$expiration = array(
				$this->data[static::EXPIRE_DATA_KEY][$key][0] == EXPIRE_ON_REQUEST ? 'EXPIRE_ON_REQUEST' : 'EXPIRE_ON_GET',
				$this->data[static::EXPIRE_DATA_KEY][$key][1] == static::EXPIRE_STATE_NEW ? 'STATE_NEW' : ($this->data[static::EXPIRE_DATA_KEY][$key][1] == static::EXPIRE_STATE_LOADED ? 'STATE_LOADED' : 'STATE_EXPIRED'),
			);
			return $expiration;
		}

		return false;
	}
945943
public function expireAt($key, $timestamp, $inMillis = false) {
        $cmd = $inMillis ? 'pexpireat' : 'expireat';

        return $this->send([$cmd, $key, $timestamp], function ($response) {
            return (bool) $response;
        });
    }
395989
public function expiresAt($key, $time = 0)
    {
        $expire = $time - time();

        return $this->redis->expire($key, $expire);
    }
557815
public function setTimeExpire( $timestamp )
	{
		if( $timestamp !== null )
		{
			$timestamp = (string) $timestamp;
			$this->_checkDateFormat( $timestamp );
		}

		$this->_values['expire'] = $timestamp;
		$this->setModified();
	}
1296490
public function setTtl($key, $ttl) {
        $redis = $this->_getRedisClient();
        $redis->expire($this->_getInternalKey($key), $ttl);
    }
299209
public Long expireAt(Object key, long unixTime) {
		Jedis jedis = getJedis();
		try {
			return jedis.expireAt(keyToBytes(key), unixTime);
		}
		finally {close(jedis);}
	}
641467
protected function handleTtl($key, $expireSetTs, $expireSec)
    {
        $ttl = $expireSetTs + $expireSec - time();
        if ($ttl <= 0) {
            unset($this->store[$key]);

            throw new KeyNotFoundException();
        }

        return $ttl;
    }
344133
public function expire($key, $timeout) {
        try {
            return $this->getRedis()->pexpire($key, $timeout);
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
1199810
public function lock($key, $timeout = self::EXPIRE): bool
    {
        $wait = 20000;
        $totalWait = 0;
        $time = $timeout * 1000000;
        $key = self::PREFIX . $key;

        while ($totalWait < $time && false === $this->mem->add($key, 1, $timeout)) {
            usleep($wait);
            $totalWait += $wait;
        }

        if ($totalWait >= $time) {
            throw new \RuntimeException('cannot get lock for waiting ' . $timeout . 's.', __LINE__);
        }

        return true;
    }