Correct composite indexing indexing order
I think your approach with nested loops is suboptimal.
Why can't you do something like:
select * from sensors where deviceid =? AND  pcode = ? AND rectime between ? and ?

This would return the whole dataset and you  could process it locally.
Selecting 500 or even more rows in one correct select is better then 500 single row selects.
In this case I would change the the clustered index to
(deviceid,pcode,rectime)

you can still keep the autoId primary key, just make it nonclustered.
In addition, the way your select works, it has to do key lookup afterwards to get one single extra row. MySQL AFAIK doesn't support include on indexes, but even then, it would be a de facto reordered copy of the table so clustered index makes sense.
As for if the order matters.... Well, yes and no. Given your datatypes and size of table, the difference would be minimal.