Your sentence is correct as is.
You can use "for..." to talk about something in the simple past time. While "for..." is taught as an expression that goes with present perfect, it applies to every tense to describe the duration.
To use the present perfect would be a mistake because it only refers to things that started in the past and continue now, or past actions that have an effect on the present.
If you said, "I have cleaned the carpet for 3 hours", it means, "the carpet is clean", or "I'm tired of cleaning carpets" or something with a present effect. In the context where it's 3 years ago, there's no reasonable present effect meaning