You could just add a filter:
where trigger_type = 'SIMPLE'
and end_time < power(2, 31) * 1000
and
SYS_EXTRACT_UTC ...
but you can't generally (or easily) control the order that Oracle evaluates the predicates, so it might still throw the same error - and inconsistently. You could instead use a case expression to control when the conversion happens, or a bit more simply here - as you are not looking very far ahead - treat any very large value as if it was the 2^31-1 limit:
+ NUMTODSINTERVAL (least(end_time / 1000, power(2, 31) - 1), 'SECOND')
Your use of sys_extract_utc
here is odd, by the way; you're specifying a time with a 3 hour offset then converting back to UTC, when you could just specify a UTC time in the first place:
TIMESTAMP '1970-01-01 00:00:00.00 UTC'
+ NUMTODSINTERVAL (least(end_time / 1000, power(2, 31) - 1), 'SECOND')
However, your comparison is having to convert every value in your table to a timestamp before comparing and filtering, which will prevent an index being used (unless you have a function-based index already, which seems unlikely when the conversion is failing). It would be more efficient to convert the target time - 7 days in the future - to an epoch number, and then compare the column values against that:
select * from qrtz_triggers
where trigger_type = 'SIMPLE'
and end_time <= 1000 * (
select 24 * 60 * 60 * extract (day from i)
+ 60 * 60 * extract (hour from i)
+ 60 * extract (minute from i)
+ extract (second from i)
from (
select SYSTIMESTAMP + INTERVAL '7' DAY - TIMESTAMP '1970-01-01 00:00:00.00 UTC' as i
from dual
)
)
db<>fiddle
Depending on the precision you're looking for, you might need to take leap seconds into consideration, but that's another topic.