Slower running Query with better Filter?
There are 3 steps in SELECTing from a PARTITIONed table.


"Partition pruning" -- deciding which partition(s) might have the data
Running the SELECT on each of those partitions
Combining the results.


Your first query could do no pruning since nothing in the WHERE clause limited which partitions to look at.

A quoted number will convert to an INT or BIGINT without trouble.  (The other direction causes trouble:  WHERE varchar_col = 123.)

The one index you have -- (itemid,clock) -- works even better without partitioning.  Do you have other queries for which you think partitioning is necessary?

You have no explicit PRIMARY KEY on that InnoDB table.  That generally hurts performance.

As for your 0sec vs 40sec, please provide EXPLAIN FORMAT=JSON SELECT ... for each of the queries.  There may be extra clues.