1 Chronicles 23:27 says:
כִּ֣י בְדִבְרֵ֚י דָוִיד֙ הָאַ֣חֲרוֹנִ֔ים הֵ֖מָּה מִסְפַּ֣ר בְּנֵֽי־לֵוִ֑י מִבֶּ֛ן עֶשְׂרִ֥ים שָׁנָ֖ה וּלְמָֽעְלָה:
which roughly translates as:
For in David's final words, the sons of the Levites were numbered from twenty years old and upwards.
The Torah says they were numbered from 30 years up. Why did King David deviate from the Torah? What do Chazal have to say about this?