A General Theory for Federated Optimization with Asynchronous and Heterogeneous Clients Updates