How to query a table efficiently without affecting live transactions
Typically, you don't want to be querying tables with high transaction volume at all; that's what a data warehouse is for.

But if you must, you can use SNAPSHOT ISOLATION. Which will query the table as of the last committed transaction before it started. This might give you dirty reads, as it may be out of date by the time the query finished running, but as you're looking at stuff 15-30 minutes in the past it should be ok.

In MySQL (assuming you're using innoDB), you can use START TRANSACTION WITH CONSISTENT SNAPSHOT; as there is no global setting for SNAPSHOT ISLOATION.

You can also look here for more info: https://dev.mysql.com/doc/refman/5.7/en/innodb-consistent-read.html