Show the matching record only for the 3 rows
If you're trying to find matching rows in two tables, UNION is not the tool.  What you want is INNER JOIN.  If you have these two datasets:

mysql&gt; SELECT * FROM box_data;
+----+----------+---------+--------+----------+--------+---------------------+
| id | box_name | diIndex | diMode | diStatus | status | last_updated        |
+----+----------+---------+--------+----------+--------+---------------------+
| 10 | boxa     |       3 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 11 | boxa     |       4 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 12 | boxa     |       5 |      0 |        0 |        | 2017-03-02 10:49:36 |
+----+----------+---------+--------+----------+--------+---------------------+
3 rows in set (0.00 sec)


and:

mysql&gt; SELECT * FROM box_data_logs;
+----+----------+---------+--------+----------+--------+---------------------+
| id | box_name | diIndex | diMode | diStatus | status | last_updated        |
+----+----------+---------+--------+----------+--------+---------------------+
|  7 | boxa     |       0 |      0 |        0 |        | 2017-03-02 10:49:35 |
|  8 | boxa     |       1 |      0 |        1 |        | 2017-03-02 10:49:35 |
|  9 | boxa     |       2 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 10 | boxa     |       3 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 11 | boxa     |       4 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 12 | boxa     |       5 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 13 | boxa     |       6 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 14 | boxa     |       7 |      0 |        0 |        | 2017-03-02 10:49:36 |
+----+----------+---------+--------+----------+--------+---------------------+
8 rows in set (0.00 sec)


and you want to find rows from box_data that have a matching id in box_data_logs, and you want to limit the selected rows to id values of 11 and 12, you would do something like this:

mysql&gt; SELECT box_data.* FROM box_data 
    INNER JOIN box_data_logs 
       ON 
    (box_data.id=box_data_logs.id AND box_data.id IN (11,12));
+----+----------+---------+--------+----------+--------+---------------------+
| id | box_name | diIndex | diMode | diStatus | status | last_updated        |
+----+----------+---------+--------+----------+--------+---------------------+
| 11 | boxa     |       4 |      0 |        0 |        | 2017-03-02 10:49:36 |
| 12 | boxa     |       5 |      0 |        0 |        | 2017-03-02 10:49:36 |
+----+----------+---------+--------+----------+--------+---------------------+
2 rows in set (0.00 sec)