Well, compiler tells the truth: Borrowed value doesn’t live long enough. I don’t really know what to tell you, maybe someone will give you a better explanation
In Rust variables are semantically meaningful, and foo().bar() is a different thing than let tmp = foo(); tmp.bar().
In your case the value (a lock) returned by borrow() is not saved anywhere, and that's why doesn't live long enough. It exists only in a temporary scope of an expression, and that temporary scope varies depending on how the expression is constructed/used (that's why match works more often than other constructs), but it's best to be explicit about which values aren't supposed to be temporary.
If you change:
if let Some(msg) = mock_messenger.sent_messages.borrow().get(0)
to
let tmp = mock_messenger.sent_messages.borrow();
if let Some(msg) = tmp.get(0)
it should work, because then get(0) will be borrowing from tmp that won't go away until the end of the outer scope, instead of a temporary object created mid-way in an expression without non-temporary storage.