This quote is found at the end of A Tale of Two Cities by Charles Dickens, and it is part of a longer speech which is "spoken" by Sidney Carton. Carton, of course, has traded places with Charles Darnay because of his selfless (but unrequited) love for Lucie Darnay. While he does not actually speak these words aloud, this entire speech is what he would have said if he had been able to speak his thoughts immediately before he is executed. The question is whether Carton's redemption and rest were the motive for or the consequence of this grand act.
It is true that this quote is "all about him," so to speak, and that can certainly be seen as being selfish. Carton also uses language which can be called superlative--"far, far better" and "ever"--and he repeats it, which can also be seen as self-aggrandizing. Carton has not done anything important or significant with his life, and one might see this last act not as a selfless demonstration of love but as an opportunity for him to find some redemption and peace at the end of his own wasted life.
That may all be true, but it does not take into account his genuine, selfless love for Lucie. What makes this act selfish or self-less is what the reader believes Carton's motive was when he died in place of Darnay. If one believes that he was motivated primarily by a pure love for Lucie, this was not a selfish act; if one believes that he was motivated primarily by the need or desire for his own redemption, this was, indeed, a totally selfish act.