simplifying logic for memcache TTL implementation