Scaling Laws and Compute-Optimal Training Beyond Fixed Training Durations