First of all, 20-30 minutes is a very long time for the query - are you sure that you do not have any indexes for the query? Check your execution plan - you can get a huge performance boost from a well-placed index.
In MySQL you could do
INSERT INTO `cached_result_table` (
SELECT your_query_here
)
(, cached_result_table , SELECT, ).
( ) - cached_result_table.
, , 20-30 , . , . :
init:
insert select your_big_query
work:
if your_big_query cached table is empty or nearing expiration:
refresh in the background:
check flag to see if there another "refresh" process running
if yes
end // don't run two your_big_queries at the same time
else
set flag
re-run your_big_query, save to cached table
clear flag
serve data to clients always from cached table