UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ibk6fSQ9LVT4QTSQ+pvmwl/Xv0ijN8XHAaNl1LJkXLA=' 
WHERE 
  key_id = '555cd8f9c7e8cf552be458298ea818ab52cb68e21f26dd4828b491682d82c4c6' 
  AND (
    token = 'ibk6fSQ9LVT4QTSQ+pvmwl/Xv0ijN8XHAaNl1LJkXLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026