The freshwater pearl mussel Margaritifera margaritifera is one of the most threatened freshwater bivalves worldwide. In this study, we aimed (i) to study the processes by which water quality might affect freshwater mussels in situ and (ii) to provide insights into the ecotoxicological significance of water pollution to natural populations in order to provide necessary information to enhance conservation strategies. M. margaritifera specimens were sampled in two close sites located upstream or downstream from an illegal dumping site. The renal transcriptome of these animals was assembled and gene transcription determined by RNA-seq. Correlations between transcription levels of each single transcript and the bioaccumulation of nine trace metals, age (estimated by sclerochronology), and condition index were determined in order to identify genes likely to respond to a specific factor. Amongst the studied metals, Cr, Zn, Cd, and Ni were the main factors correlated with transcription levels, with effects on translation, apoptosis, immune response, response to stimulus, and transport pathways.However, the main factor explaining changes in gene transcription appeared to be the age of individuals with a negative correlation with the transcription of retrotransposon-related genes. To investigate this effect further, mussels were classified into three age classes. In young, middle-aged and old animals, transcription levels were mainly explained by Cu, Zn and age, respectively. This suggests differences in the molecular responses of this species to metals during its lifetime that must be better assessed in future ecotoxicology studies.