The two expressions
$$E = \frac{1}{2}mu^2 + \frac{1}{2}kx^2;$$ $$E = \sum_{i=1}^{n} (K_i + P_i)$$
are aren't quite equivalent; they have different reference values. (Energy has no absolute value; we always need to specify a reference, and we often use different reference levels for convenience in different analysis frameworks.)
The first equation ignores thermal energy, or alternatively sets the reference value of energy as a motionless mass and an undeformed spring at room temperature. Here, we've also implicitly assumed that the mass is rigid (i.e., that any energy change of interest is associated only with its bulk kinetic energy, or the kinetic energy of its center of mass) and that the spring is massless (i.e., that any energy change of interest consists of only strain energy).
The second equation dispenses with the lumped-component assumptions of a mass and spring, which makes it more general but also less amenable to problems involving such idealized macroscale objects.
Does this getA practical example is spontaneous vibration of atomic-force-microscopy cantilevers. These extremely thin beams—deliberately designed to be compliant enough to deform from atomic-scale asperities and attractive forces on surfaces—are also compliant enough to detectably vibrate at what you're asking about?room temperature from thermal energy alone:
Sevim, S., Shamsudhin, N., Ozer, S. et al. An atomic force microscope with dual actuation capability for biomolecular experiments. Sci Rep 6, 27567 (2016).
Here, the feature of interest is the 18 kHz peak in air, indicating the excitation of natural resonance from thermal motion. (The peak is dampened and shifted to 4 kHz in water.)
From the equipartition theorem, we can estimate the amplitude of the resulting motion or the speed of the cantilever tip at any particular temperature. For the former, we set $\frac{1}{2}k_BT=\frac{1}{2}k\widehat{x^2}$, where $\widehat{x^2}$ (sometimes $\langle{x^2}\rangle$) is the mean squared thermal deflection, as discussed by Butt & Jaschke in "Calculation of thermal noise in atomic force microscopy."
For more discussion and references in this context, see Ma et al., "Thermal noise in contact atomic force microscopy".