That quote is not actually in the play "Hamlet". The quote was said by Iberius Claudius Caesar Augustus Germanicus. He was the fourth Roman Emperor of the Julio-Claudian dynasty.
King Claudius is a character in Hamlet, but it is not the same person or based on the historical figure of Claudius I. While it may be appropriate to apply the quote to the character of Hamlet, the play and the quote are otherwise unrelated.