Get retrieves a value from the cache. It returns the value associated with the key
and a boolean indicating whether the key was found.
The method first checks if the entry is still valid based on the ttl.
If it is not, it removes the entry from the cache.