input: Write a python function to store and fetch items with TTL (time-to-live) in a cache storage.
  assert storage.fetch("key1") is None
  storage.store("key1", "value1")
  assert storage.fetch("key1") == "value1"
  time.sleep(2)
  assert storage.fetch("key1") is None
output: import time
  from threading import Lock
  
  class TTLCache:
      def __init__(self, ttl=1):
          self.ttl = ttl
          self.cache = {}
          self.lock = Lock()
  
      def store(self, key, value):
          expire_time = time.time() + self.ttl
          with self.lock:
              self.cache[key] = (value, expire_time)
  
      def fetch(self, key):
          current_time = time.time()
          with self.lock:
              if key in self.cache:
                  value, expire_time = self.cache[key]
                  if current_time < expire_time:
                      return value
                  else:
                      del self.cache[key]
          return None
  
  storage = TTLCache(ttl=1)