Ok thats the problem then. The mysql grafana datasource expects an integer value in the timesec column but unix_timestamp needs a datetime or timestamp datatype to work. So for your query to work you need to convert it to datetime first.
Something like the following query should get you closer to what you need
SELECT
UNIX_TIMESTAMP(STR_TO_DATE(timestamp,'%M %d %Y %h:%i:%s%p')) as time_sec,
masa as value,
'value' as metric
FROM dbo.masa_baterii
ORDER BY timestamp
SELECT
UNIX_TIMESTAMP(STR_TO_DATE(timestamp,'%M %d %Y %h:%i%p')) as time_sec,
masa as value,
'value' as metric
FROM dbo.masa_baterii
ORDER BY timestamp
You might have to modify '%M %d %Y %h:%i%p' to match your date but the STR_TO_DATE must be able to parse your timestamp string, after that you can convert it to unix timestamp so grafana can process it.