That query would probably take quite some time with large datasets, because of the amount of conditions being applied in the JOIN. Especially with more complex expressions appearing before some quick conditions. That might explain losing the connection - but don't bet your socks on it.
What I would, instead, suggest is to build the table with a faster (really simple commands) JOIN, and then filter out unwanted data with a where clause.
Now, in your first JOIN condition you have a tbl_1.doDate = tbl2.doDate, however later on you include the dates in a calculation.
There are also ways you can make it more efficient by subtracting the dates and seeing if they lie between - 1 minute and + 1 minute, rather than running that concatenation/addtime stuff multiple times per line.
Make a backup before trying this, but I'd guess at something like:
LEFT JOIN tbl_2 ON
tbl_1.myCodeLine = tbl_2.myCodeLine
tbl_1.doDate = tbl_2.doDate
tbl_2.eLClass = 'tm';
tbl_1.id <> tbl_2.id
SET tbl_1.Class = 'ok'
CAST(SUBTIME(LEFT(tbl_1.doHour, 5), LEFT(tbl_2.doHour, 5)) AS TIME) BETWEEN CAST("-0:01:00" AS TIME) AND CAST("0:01:00" AS TIME)
Other things may be the cause of your problems, and it's definitely possible that query isn't the cause of it. But it's worth a shot.