A Unified Convergence Theorem for Stochastic Optimization Methods