How should I format my code to make it easier to read and understand in the future
I prefer using JOIN...ON, clarifying an intention of priority of OR and AND phrase.

SELECT
  events.event_time,
  messages . *
FROM
  events
  JOIN messages ON events.global_id = messages.global_ref_id
WHERE
    ((messages.to =184 AND messages.from =192)
      OR (messages.to =192 AND messages.from =184))
    AND messages.global_ref_id &lt; 495
ORDER BY
  messages.global_ref_id ASC