Yes, it can (does) happen. If driver_id is the same for trips (A)
and (B), then (4) should be related to both, otherwise it's ignored.
But this is a minor concern--we may as well ignore (4) althogether for
the time being.

However, the above query has been running for just over two hours
now on a dataset of ~26000 logs and ~4000 monitor records. I suppose
I could have limited the logs to the (shorter) time range covered by
the monitor records, but it's still incredibly slow.

This problem has been bugging me for well over a year now, but I
still cannot seem to find a good way of doing it. Maybe it's time to
find me another job :)

Seriously, though, thanks to those who have replied so far, and I
appreciate any and all comments and ideas on this matter.