Handled cases where ttl can return None in either case (no TTL or non-existent key)