How to Insert TimeStamps Into SQL

Here is an example of formatting a datetime field for an INSERT statement in MySQL

Note that for me in UK and with my database locale set to UTC, this value "2025-06-16 23:12:28" is accepted in an INSERT query.
You may need a different format depending on your locale and the locale of your database.
Make sure you verify that the timestamps stored in the database are what you would expect to see.

Here is an example of constructing a prepared INSERT statement, which is much safer than your code

It's up to you how you construct msg.payload but flow context is not desirable and should not be needed. I suggest you read up on the join node manual mode.