UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UfUD+XOSJ6PDfy8oSrdIdY7TqshJhnTrkRKOwS22mjI='
WHERE
key_id = '1095ab7f8862fd1c51b1b39c41f37af257bf68f53b1526830695b56f6a170bf4'
AND (
token = 'UfUD+XOSJ6PDfy8oSrdIdY7TqshJhnTrkRKOwS22mjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)