The spread of Coronavirus Disease 2019 (COVID-19), caused by the SARS-CoV-2 coronavirus, has progressed into a global pandemic. To date, thousands of genetic variants have been identified across SARS-CoV-2 isolates from patients. Sequence analysis reveals that the codon usage of viral sequences decreased over time but fluctuated from time to time. In this study, through evolution modeling, we found that this phenomenon might result from the virus' preference for mutations during transmission. Using dual luciferase assays, we further discovered that the deoptimization of codons on viruses might weaken protein expression during the virus evolution, indicating that the choice of codon usage might play important role in virus fitness. Finally, given the importance of codon usage in protein expression and particularly for mRNA vaccine, we designed several omicron BA.2.12.1 and BA.4/5 spike mRNA vaccine candidates based on codon optimization, and experimentally validated their high levels of expression. Our study highlights the importance of codon usage in virus evolution and mRNA vaccine development.