Can I run this in one command line (ffmpeg)
Your current method using the concat demuxer while stream copying is probably the fastest (I'm just counting the ffmpeg time and not any time you take to enter the additional commands). Unfortunately, you have to perform several steps, but the advantage is that your non-filtered segments are not being re-encoded which preserves quality and results in fast processing.

It is possible to do it all in one command with the trim, atrim, and concat filters, but this will re-encode everything and possibly be slower. You will have to test. However, it may create a more "stable" output if you find your current method to be problematic (which would likely be fairly obvious upon playback). The filter is generally used instead of the demuxer when all streams are being filtered.

Example using concat filter:

ffmpeg -i input.mp4 -filter_complex \
"[0:v]trim=end=10[v0]; \
 [0:a]atrim=end=10[a0]; \
 [0:v]trim=10:40,drawbox=color=invert[v1]; \
 [0:a]atrim=10:40[a1]; \
 [0:v]trim=start=40[v2]; \
 [0:a]atrim=start=40[a2]; \
 [v0][a0][v1][a1][v2][a2]concat=n=3:v=1:a=1[v][a]" \
-map "[v]" -map "[a]" -movflags +faststart output.mp4


Notes


If you get a weird output refer to the setpts, asetpts filters (search for PTS-STARTPTS).
If it is still too slow use a faster x264 preset. See FFmpeg Wiki: H.264 Video Encoding Guide.
I assume you're using OS X with the "tessus" build of ffmpeg from your previous FFmpeg question. The default AAC encoder for the tessus build is libvo_aacenc. The native FFmpeg AAC encoder is generally regarded as being slightly better. If you want to use it add -c:a aac -strict experimental. If you want the best supported AAC encoder, libfdk_aac, then use homebrew to compile ffmpeg. See FFmpeg Wiki: AAC Encoding Guide.