@API.register<EOL><INDENT>@API.aiocache_enabled(fake_return=False)<EOL>@API.timeout<EOL>@API.plugins<EOL>async def expire(self, key, ttl, namespace=None, _conn=None):<DEDENT>
start = time.monotonic()<EOL>ns_key = self.build_key(key, namespace=namespace)<EOL>ret = await self._expire(ns_key, ttl, _conn=_conn)<EOL>logger.debug("<STR_LIT>", ns_key, ret, time.monotonic() - start)<EOL>return ret<EOL>
Set the ttl to the given key. By setting it to 0, it will disable it

:param key: str key to expire
:param ttl: int number of seconds for expiration. If 0, ttl is disabled
:param namespace: str alternative namespace to use
:param timeout: int or float in seconds specifying maximum timeout
    for the operations to last
:returns: True if set, False if key is not found
:raises: :class:`asyncio.TimeoutError` if it lasts more than self.timeout