The maxim ‘Cover an honour with an honour’ coming from the early days of whist is usually sound but may be wrong sometimes.
It is usually right to cover if you hold intermediate cards that covering might promote, or if your holding is short, when partner might hold such cards. It is usually wrong to cover if you have length in the suit and poor intermediates, or if the honour led is a touching honour.
Generally, East should cover the queen with the king on the first layout (West might hold 10-x-x or A-10-x) but not on the second (South might hold A-J-10-9-x).