Fixed cached data expiration check logic