[1] I bought the book [which I had read two years ago] [and which had the
author's autograph].
[2] I bought the book [which I had read two years ago], and it had the
author's autograph.
[1] and [2] have the same meaning: you bought the book; you had read the book two years ago; the book had the author's autograph.
The temporal PP "two years ago" doesn't 'follow' the relative clause, as you put it, but is actually part of it. Thus "which I had read two years ago" modifies "book", not "bought".
If you want the relative clause to refer to "bought" you'll need to use a non-defining relative, as in [3].
[3] I bought the book, which I had already read, two years ago.
though it would be better with an adverb such as "already", as shown.
Note, though, that non-defining relatives are supplements, not modifiers.